import Data.List

item [] = []
item [x] = [x]
item l@(x:xs) = x : show (length l)

cmp [] = []
cmp xs = concat $ map item l
    where l = group xs
    
main = do
    msg <- getLine
    putStr $ cmp msg
    
    